/**
 * @Author：尚志豪
 * @Package：PACKAGE_NAME
 * @Project：ruoyiszh
 * @name：test
 * @Date：2024/12/12 10:08
 */


public class test {
//    饿汉模式
    private test() {}
    private static test singleton = new test();

    public static test getInstance(){
        return singleton;
    }
//    懒汉模式
    private static volatile test in = null;

    public static test getInstances(){
        if (in == null){
            synchronized (test.class){
                if (in ==null) {
                    in = new test();
                }
            }
        }
        return in;
    }
}
